import { createSSRApp } from 'vue'
import App from './App.vue'
import { InitializeMiniProgram, runtimeEnvironment } from './InitializeMiniProgram'
import { getLocationSearch, SetStorage } from './utils/uni.public'
import { enumPaychannel } from '@/utils/enum'
import filters from './utils/filters'
//#ifdef H5
import "@/static/font/font.css" // 引入字体样式
// import VConsole from 'vconsole'
import { autoRefresh } from "./utils/autoMaticUpdate";
//#endif


export function createApp() {
  // @ts-ignore
  const app = createSSRApp(App)
  new InitializeMiniProgram()
  // 定义全局变量
  // console.log(filters, 'mian.ts');
  app.config.globalProperties.$systemId = 10
  app.config.globalProperties.$filters = filters
  app.config.warnHandler = () => null;
  //#ifdef H5
  const runTime = new runtimeEnvironment(),
      urlQuery = <any>getLocationSearch(runTime.url) || {}; // 进入页面url携带的参数
  app.config.globalProperties.$runtimeEnvironment = runTime
  console.log(runTime, 'runTime, urlQuery')
  //#endif

  return {
    app
  }
}